/**
 * 
 */
package org.softTank.BC.data;

import java.util.ArrayList;
import java.util.List;

import org.softTank.BC.entity.services.Operation;
import org.softTank.BC.entity.services.PortType;
import org.softTank.BC.entity.services.Role;
import org.springside.modules.test.DataUtils;

/**
 * @author Yuzone
 *
 */
public class PortTypeData {

	public static PortType getRandomPortTypeWithoutFK() {
		PortType pt = new PortType();
		pt.setName(DataUtils.randomName("portType"));
		pt.setNamespace("ns");
		pt.setDescription("desc");
		pt.setLocation("location");

		return pt;
	}

	public static PortType getRandomPortTypeWithFK() {
		PortType pt = getRandomPortTypeWithoutFK();
		pt.setId(1L);
		List<Role> rl = new ArrayList<Role>();
		rl.add(RoleData.getTestRole());
		pt.setRoleList(rl);
		List<Operation> ol = new ArrayList<Operation>();
		ol.add(OperationData.getTestOperation());
		pt.setOperationList(ol);

		return pt;
	}

	public static PortType getTestPortType() {
		PortType pt = getRandomPortTypeWithoutFK();
		pt.setId(1L);

		return pt;
	}

	public static PortType getPortTypeWithInferiors() {
		PortType pt = getRandomPortTypeWithoutFK();
		pt.setId(1L);
		List<Operation> ol = new ArrayList<Operation>();
		ol.add(OperationData.getOperationWithInferiors());
		pt.setOperationList(ol);

		return pt;
	}
}
